package cn.wolfcode.trip.base.domain;
import cn.wolfcode.trip.base.util.DateUtil;
import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

/**
 * 大攻略
 */

@Getter
@Setter
public class Strategy extends BaseDomain{
    public static final Integer STATE_NORMAL=0;//普通
    public static final Integer STATE_COMMEND=1;//推荐
    public static final Integer STATE_DISABLE=-1;//禁用
    private Region place;

    private String title;

    private String subTitle;

    private String coverUrl;

    private Integer state=STATE_NORMAL;

    public String getStateName(){
        String msg="普通";
        if(this.state==STATE_COMMEND){
            msg="推荐";
        }else if(this.state==STATE_DISABLE){
            msg="禁用";
        }
        return msg;
    }

    public String getJson(){
        HashMap map = new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("subTitle",subTitle);
        map.put("coverUrl",coverUrl);
        if(place!=null){
        map.put("placeId",place.getId());
        }
        map.put("state", state);
        return JSONUtil.toJSONString(map);
    }


}